'''requests 基本使用方式'''
'''GET 请求'''
import requests
response = requests.get(r'http://baidu.com')
print(type(response))
print(dir(response))
'''服务器返回的状态码 状态信息'''
print(response.status_code,response.reason)
'''cookie 信息'''
print(response.cookies)
'''text 为 获取到的响应数据'''
print(response.text)

'''requests 各种请求方式'''
# requests.post()
# requests.put()
# requests.delete()
# requests.head()
# requests.options()
'''GET 基本请求'''
url_string = r'http://httpbin.org'
'''带参数'''
url_string = url_string + '/get?uname=IG.wxz&usex=男'
response = requests.get(url_string)
print(response.text)
'''带参数的第二种写法'''
parms = {
    'uname':'王者荣耀',
    'usex':4
}
url_string = r'http://httpbin.org'
response = requests.get(url_string+'/get',params=parms)
print(response.text)

url_string = r'http://douban.uieee.com/v2/movie/in_theaters'
response = requests.get(url_string)
print(response.json())
obj = response.json()
move_list = obj['subjects']
for item in move_list:
    print(item['title'])